package com.erp.erp_mask.controller;

import com.erp.erp_mask.pojo.TManufactureplan;
import com.erp.erp_mask.pojo.TPurchase;
import com.erp.erp_mask.pojo.TSalesorders;
import com.erp.erp_mask.service.TManufactureplanService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/pur")
public class manufactureplantongController {

    @Resource
    private TManufactureplanService tManufactureplanService;

    @GetMapping("/sellapply")
    private ModelAndView index() {
        return new ModelAndView("pro/manufactureplan");
    }


    @GetMapping("/tj")
    public List<Object> tj(){
        List<Object> objects=new ArrayList<>();
        List<TManufactureplan> list=tManufactureplanService.tjmanu();
        for (TManufactureplan cc:list){
            int dd=cc.getTotalmanu();
            String date=cc.getBillsmonth();
            objects.add(new Object(){
                public int value=dd;
                public String name=date;
                @Override
                public String toString(){
                    return "{"+dd+","+date+"}";
                }
            });
        }
        return objects;
    }




}
